package com.dahaiwuliang.code.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * y用户下载实体
 * @author bzd
 */
@Entity
@Table (name = "userDownload")
@JsonIgnoreProperties (value = {"hibernateLazyInitializer","hander","fieldHandler"})
public class UserDownload implements Serializable {

    private static final long serialVersionUID = -3133659058218461615L;
    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    private Integer userDownloadId;          //用户下载id

    @JsonFormat (pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat (pattern = "yyyy-MM-dd HH:mm:ss")
    private Date downloadDate;  //下载时间
    @ManyToOne
    @JoinColumn(name = "articleId")
    private Article article; //下载文章id

    @ManyToOne
    @JoinColumn(name = "userId")
    private User user; //下载用户Id

    public Integer getUserDownloadId() {
        return userDownloadId;
    }

    public void setUserDownloadId(Integer userDownloadId) {
        this.userDownloadId = userDownloadId;
    }

    public Date getDownloadDate() {
        return downloadDate;
    }

    public void setDownloadDate(Date downloadDate) {
        this.downloadDate = downloadDate;
    }

    public Article getArticle() {
        return article;
    }

    public void setArticle(Article article) {
        this.article = article;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }



}
